package lab.anoper.fsm.controller;

import lab.anoper.fsm.entity.Role;
import lab.anoper.fsm.mapper.RoleMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class RoleController {
    private RoleMapper mapper;

    @Autowired
    public RoleController(RoleMapper mapper) {
        this.mapper = mapper;
    }

    @GetMapping
    public Role getRoleById(@Param("id") Long id) {
        return mapper.findById(id);
    }
}
